package com.cq.hd.task.web.job;

import com.cq.hd.member.api.TbMemberCardBillApi;
import com.cq.hd.member.api.TbMemberFeeBillApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MemberFeeCardTask {

    @Autowired
    private TbMemberCardBillApi memberCardBillApi;

    @Autowired
    private TbMemberFeeBillApi memberFeeBillApi;

    // 每天凌晨0点20分执行一次    0 20 0 * * ?
    @XxlJob("removeWaitPayCardFee")
    public void execute() {
        log.info("清空3天前的待支付的会员续费记录和次卡购买记录=====>开始");
        memberCardBillApi.removeWaitPayJob();
        memberFeeBillApi.removeWaitPayJob();
        log.info("清空3天前的待支付的会员续费记录和次卡购买记录=====>结束");
    }
}
